<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/h-ui/css/H-ui.admin.css">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/h-ui/style.css">
    <script type="text/javascript" src="${ctx}/appjs/enterprise/enterpriseSubmemberApply/enterpriseSubmemberApply.js"></script>
    <style>
        .form-group img {
            cursor: pointer
        }
    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>企业成员列表</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>编辑企业成员</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <div class="columns pull-left">
                        <h5 class="font-bold">编辑</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="frm">
                        <input type="text" value="${submemberApply.submemberApplyId}"  name="submemberApplyId" hidden>
                        <input type="text" value="${submemberApply.applyStatus}"  name="applyStatus" hidden>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">成员名称：</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="${submemberApply.nickname}" name="nickname" >
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">手机号：</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="${submemberApply.phone}"  name="phone" >
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">所属企业：</label>
                            <div class="col-sm-4">
                                <select id="enterpriseId" name="enterpriseId" class="form-control" placeholder="">
                                    <option value="" selected="selected">请选择</option>
                                    <c:forEach items="${enterpriseList}" var="enterprise">
                                        <option value="${enterprise.enterpriseId}"
                                                <c:if test="${enterprise.enterpriseId eq submemberApply.enterpriseId}">selected</c:if>
                                            >${enterprise.enterpriseName}
                                        </option>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">推荐人ID：</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="${submemberApply.recommenderId}"  readonly>
                            </div>
                        </div>
<%--                        <div class="form-group row">--%>
<%--                            <label class="col-sm-3 col-form-label text-right">微信：</label>--%>
<%--                            <div class="col-sm-4">--%>
<%--                                <input type="text" class="form-control" value="${submemberApply.nickname}" name="nickname" >--%>
<%--                            </div>--%>
<%--                        </div>--%>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">生日：</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="<fmt:formatDate value="${submemberApply.birthday}" pattern="yyyy-MM-dd" />" readonly>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">性别：</label>
                            <div class="col-sm-4">
                                <select disabled class="form-control" id="sex" name="sex" disabled>
                                    <option value="0" ${submemberApply.sex=="0"?"selected":""}>未知</option>
                                    <option value="1" ${submemberApply.sex=="1"?"selected":""}>男</option>
                                    <option value="2" ${submemberApply.sex=="2"?"selected":""}>女</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">通讯地址：</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" value="${submemberApply.address}" name="address">
                            </div>
                        </div>
                        <%--<div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">是否管理员：</label>
                            <div class="col-sm-4">
                                <select class="form-control" id="hasPermission" name="hasPermission">
                                    <option value="0" ${submemberApply.hasPermission=="0"?"selected":""}>否</option>
                                    <option value="1" ${submemberApply.hasPermission=="1"?"selected":""}>是</option>
                                </select>
                            </div>
                        </div>--%>

                        <div class="form-group">
                            <div class="col-sm-3 col-sm-offset-8 text-right">
                                <button type="submit" class="btn btn-success">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">


    $("#file1").change(function () {
        var file = this.files[0];
        var reg = RegExp(/image/);
        if (!reg.test(file.type)) {
        	parent.layer.msg("支持图片上传");
        	return;
        }
        var objUrl = getObjectURL(this.files[0]);//获取文件信息
        if (objUrl) {
            $("#levelLogo").attr("src", objUrl);
        }
    });

    $("#file2").change(function () {
        var file = this.files[0];
        var reg = RegExp(/image/);
        if (!reg.test(file.type)) {
        	parent.layer.msg("支持图片上传");
        	return;
        }
        var objUrl = getObjectURL(this.files[0]);//获取文件信息
        if (objUrl) {
            $("#companyImg2").attr("src", objUrl);
        }
    });

    function getObjectURL(file) {
        var url = null;
        if (window.createObjectURL != undefined) {
            url = window.createObjectURL(file);
        } else if (window.URL != undefined) { // mozilla(firefox)
            url = window.URL.createObjectURL(file);
        } else if (window.webkitURL != undefined) { // webkit or chrome
            url = window.webkitURL.createObjectURL(file);
        }
        return url;
    }

    saveApplyRecord.init();
</script>
</body>
</html>
